<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of SaveToFileByComment
 *
 * @author Implement <hdjahs@qq.com>
 */
class SaveToFileByComment {

    private $obj;

    public function __construct($obj) {
        $this->obj = $obj;
    }

    public function save() {
        if ($this->obj->comment) {
            $tool = Tool::getIns();
            $filePath = $this->obj->txtPath . $this->obj->key . '.txt'; 
            file_put_contents($filePath, $this->obj->comment);
        }
    }

}
